Martim Afonso de Castro (died in Malacca, June 3, 1607) was a Portuguese Viceroy of India. He commanded the Portuguese Navy in the Battle of Cape Rachado, fought over the present day Malaccan exclave of Tanjung Tuan in 1606.